/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "boleta")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Boleta.findAll", query = "SELECT b FROM Boleta b"),
    @NamedQuery(name = "Boleta.findByNumeroBoleta", query = "SELECT b FROM Boleta b WHERE b.numeroBoleta = :numeroBoleta"),
    @NamedQuery(name = "Boleta.findByCodigoBoleta", query = "SELECT b FROM Boleta b WHERE b.codigoBoleta = :codigoBoleta"),
    @NamedQuery(name = "Boleta.findByIdCompetencia", query = "SELECT b FROM Boleta b WHERE b.idCompetencia = :idCompetencia"),
    @NamedQuery(name = "Boleta.findByTipo", query = "SELECT b FROM Boleta b WHERE b.tipo = :tipo"),
    @NamedQuery(name = "Boleta.findByRecibida", query = "SELECT b FROM Boleta b WHERE b.recibida = :recibida"),
    @NamedQuery(name = "Boleta.findByFechaIngreso", query = "SELECT b FROM Boleta b WHERE b.fechaIngreso = :fechaIngreso")})
public class Boleta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "numero_boleta")
    private String numeroBoleta;
    @Id
    @Basic(optional = false)
    @Column(name = "codigo_boleta")
    private String codigoBoleta;
    @Column(name = "id_competencia")
    private String idCompetencia;
    @Column(name = "tipo")
    private String tipo;
    @Column(name = "recibida")
    private Boolean recibida;
    @Column(name = "fecha_ingreso")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaIngreso;

    public Boleta() {
    }

    public Boleta(String codigoBoleta) {
        this.codigoBoleta = codigoBoleta;
    }

    public String getNumeroBoleta() {
        return numeroBoleta;
    }

    public void setNumeroBoleta(String numeroBoleta) {
        this.numeroBoleta = numeroBoleta;
    }

    public String getCodigoBoleta() {
        return codigoBoleta;
    }

    public void setCodigoBoleta(String codigoBoleta) {
        this.codigoBoleta = codigoBoleta;
    }

    public String getIdCompetencia() {
        return idCompetencia;
    }

    public void setIdCompetencia(String idCompetencia) {
        this.idCompetencia = idCompetencia;
    }

    public String getTipo() {
        return tipo;
    }

    public void setTipo(String tipo) {
        this.tipo = tipo;
    }

    public Boolean getRecibida() {
        return recibida;
    }

    public void setRecibida(Boolean recibida) {
        this.recibida = recibida;
    }

    public Date getFechaIngreso() {
        return fechaIngreso;
    }

    public void setFechaIngreso(Date fechaIngreso) {
        this.fechaIngreso = fechaIngreso;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoBoleta != null ? codigoBoleta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Boleta)) {
            return false;
        }
        Boleta other = (Boleta) object;
        if ((this.codigoBoleta == null && other.codigoBoleta != null) || (this.codigoBoleta != null && !this.codigoBoleta.equals(other.codigoBoleta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Logica.Boleta[ codigoBoleta=" + codigoBoleta + " ]";
    }
    
}
